import java.util.Scanner;

public class Test {
    public  static int func(String str){
        int ret=str.lastIndexOf(' ');
        String str2=str.substring(ret+1);
        ret=str2.length();
        return ret;
    }
    public static boolean isYouXiao(char ch){
        if(ch>='0'&&ch<='9'||ch>='a'&&ch<='z'){
            return true;
        }
        return false;
    }
    public static boolean isHuiWen(String str){
    str=str.toLowerCase();
    int left=0;
    int right=str.length()-1;
    while(left<right){
        while(left<right&&!isYouXiao(str.charAt(left))){
            left++;
        }
        while(left<right&&!isYouXiao(str.charAt(right))){
            right--;
        }
        if(str.charAt(left)!=str.charAt(right)){
            return false;
        }
        left++;
        right--;
    }
    return true;

    }

    public static void main(String[] args) {  //判断是否为回文
        Scanner sc=new Scanner(System.in);
        String str1=sc.nextLine();
        boolean flag=isHuiWen(str1);
        System.out.println(flag);
    }
    public static void main1(String[] args) {   //打印最后一个单词的长度
        Scanner sc=new Scanner(System.in);
        String str1=sc.nextLine();
        int c=func(str1);
        System.out.println(c);

    }
}
